Skip to content

Bring the max stacking depth limit back for marker timings#4898

Merged
canova merged 1 commit into
firefox-devtools:mainfrom
canova:marker-timing-depth-limit
Jan 24, 2024
Merged

Bring the max stacking depth limit back for marker timings#4898
canova merged 1 commit into
firefox-devtools:mainfrom
canova:marker-timing-depth-limit

Conversation

@canova

@canova canova commented Jan 23, 2024

Copy link
Copy Markdown
Member

This brings back the MAX_STACKING_DEPTH that was removed in 6920425 to make the marker chart more performant for cases where there are a lot of marker that are stacked on top of each other.

For example:
Before / After
Before / After

Fixes #4808 and one of the profile is from #4894.

@canova canova marked this pull request as ready for review January 24, 2024 09:42
@canova canova force-pushed the marker-timing-depth-limit branch from 678dac8 to 921f56d Compare January 24, 2024 09:43
@canova canova changed the title [deploy preview] Bring the max stacking depth limit back for marker timings Bring the max stacking depth limit back for marker timings Jan 24, 2024
@canova

canova commented Jan 24, 2024

Copy link
Copy Markdown
Member Author

@julienw I did some more testing and it looks like it works well. I think it's safe to land, what do you think about it?

@canova canova requested a review from julienw January 24, 2024 09:45
@codecov

codecov Bot commented Jan 24, 2024

Copy link
Copy Markdown

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (996ae19) 88.42% compared to head (e59c9b0) 88.42%.

Files Patch % Lines
src/profile-logic/marker-timing.js 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4898      +/-   ##
==========================================
- Coverage   88.42%   88.42%   -0.01%     
==========================================
  Files         304      304              
  Lines       27183    27186       +3     
  Branches     7330     7331       +1     
==========================================
+ Hits        24037    24039       +2     
- Misses       2928     2929       +1     
  Partials      218      218              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

break;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we add a new markerTiming track, then you rely that the markerTiming entry is empty, and then that markerTiming.end[markerTiming.length - 1] will be undefined, but I think it would be good to be more explicit.
How about keeping the exact same logic to before, but simply add a guard after line 164:

if (markerTimingsForName.length >= MAX_STACKING_DEPTH) {
  // There's too many markers around the same time already, let's ignore this marker.
  continue;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's right that we can keep the same logic and add this guard. Initially I came back to using good-old for loop instead of find because sometimes I feel like find is actually slower :) But I did some testing now and it looks like for this case it actually makes it faster. So reverting this to find sounds like a better path forward. Updated the code.

@canova canova force-pushed the marker-timing-depth-limit branch from 921f56d to 46ad8e3 Compare January 24, 2024 13:05
@canova canova force-pushed the marker-timing-depth-limit branch from 46ad8e3 to e59c9b0 Compare January 24, 2024 13:07
@canova canova merged commit 33ec4b7 into firefox-devtools:main Jan 24, 2024
@canova canova deleted the marker-timing-depth-limit branch January 24, 2024 16:32
@julienw julienw mentioned this pull request Feb 6, 2024
julienw added a commit that referenced this pull request Feb 6, 2024
[@canova Nazım Can Altınova] Return null instead of throwing an error if it fails to get the resource name in active tab view (#4905)
[@fqueze Florian Quèze] Improve the precision of the getFittedText implementation. (#4893)
[@fqueze Florian Quèze] Show marker count next to the marker name in the marker chart when a marker is hovered. (#4892)
[@mstange Markus Stange] Convert some code to use the non-inverted call node table even while we're showing the inverted call tree (Merge PR #4899)
[@canova Nazım Can Altınova] Bring the max stacking depth limit back for marker timings (#4898)
[@mstange Markus Stange] Various preparations in call tree code for fast inverted tree (Merge PR #4897)
[@mstange Markus Stange] Move call node path/index conversion functions into CallNodeInfo (Merge PR #4896)
[@mstange Markus Stange] Make mergeFunction fast (Merge PR #4895)
[@gthb Gunnlaugur Thor Briem] feat: support from-url profiles in compare (#4875)

And all the locale contributors:
de: Michael Köhler
el: Jim Spentzos
en-GB: Ian Neal
es-CL: ravmn
fr: Théo Chevalier
fy-NL: Fjoerfoks
ia: Melo46
it: Francesco Lodolo [:flod]
nl: Fjoerfoks, Mark Heijl
pt-BR: Marcelo Ghelman
ru: Valery Ledovskoy
sv-SE: Andreas Pettersson
uk: Artem Polivanchuk
zh-CN: 你我皆凡人, Olvcpr423, Pontoon
zh-TW: Pin-guang Chen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lots of markers cause the profiler to lock up

2 participants